home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / ContourPlot / Source / contour.h < prev    next >
Text File  |  1993-01-13  |  2KB  |  52 lines

  1. /* contour.h */
  2.  
  3. #import <appkit/color.h>
  4.  
  5.  
  6. #define epsilon .0002
  7.  
  8.  
  9. #ifndef MIN
  10. #define MIN(x, y) (((x) < (y)) ? (x) : (y))    /* min and max value macros */
  11. #endif
  12. #ifndef MAX
  13. #define MAX(x, y) (((x) > (y)) ? (x) : (y))
  14. #endif
  15.  
  16.  
  17.  
  18. /* Each contour path found is stored in this structure */
  19. typedef struct contour_path {
  20.     struct contour_path *next;    /* pointer to next contour path */
  21.     float  *x;            /* X coordinate array */
  22.     float  *y;            /* Y coordinate array */
  23.     float  level;            /* contour's level */
  24.     int    num_pts;            /* # of points in this path */
  25.     int    closed;            /* non-zero if contour is closed */
  26.     int    levelindex;        /* levelindex-th contour level */
  27.     int    hi_inside;        /* non-zero if inside contour is going up */
  28. } ContourPath;
  29.  
  30.  
  31.  
  32. /* User specified attribute for each contour level */
  33. typedef struct contour_attribute {
  34.     float    level;    /* value of contour level */
  35.     float    linewidth;    /* line width */
  36.     int    dash;        /* dash type */
  37.     int    anotate;    /* non-zero if this contour should be annotated */
  38.     NXColor    linecolor;    /* color of contour line */
  39.     NXColor fillcolor_hi;    /* color of fill when inside is higher */
  40.     NXColor fillcolor_lo;    /* color of fill when inside is lower */
  41. } CntrAttribute;
  42.  
  43.  
  44.  
  45. int computeContour(id vObj, int nx, int ny, float *x, float *y, float *f,
  46.         int ncont, CntrAttribute *cAttr);
  47.  
  48. void sort_contourList(ContourPath *cntrList, float xxmin, float xxmax, float yymin, float yymax,
  49.             int nContours, ContourPath **SCntrPtr);
  50. int non_zero_winding(float xp, float yp, float *x, float *y, int n_path);
  51.  
  52.